<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <script src="react-demos/build/react.development.js"></script>
        <script src="react-demos/build/react-dom.development.js"></script>
        <script src="react-demos/build/babel.min.js"></script>
    </head>
    <body>
        <div id="example"></div>
        <script type="text/babel">
          class NoteList extends React.Component{
            render() {
              return (
                <ol>
                  {  /* 之前用过map，大概用法就是：集合.map（单个元素,处理当个元素函数），函数里用到的一个无序列表li*/
                    React.Children.map(this.props.children, function (child) {
                      return <li>{child}</li>;
                    })
                  }
                </ol>
              );
            }
          }

          ReactDOM.render(
            <NoteList> 
              <span>hello</span>
              <span>world</span>
              <span>shafish</span>
            </NoteList>,
            document.getElementById("example")
          );
        </script>
      </body>
</html>